/*
 * Copyright (c) 2025, 大连理工大学 (Dalian University of Technology)
 *
 * Licensed under the Mulan PSL v2.
 * You can use this file according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of the License at
 *
 *     http://license.coscl.org.cn/MulanPSL2
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. SEE THE MULAN PSL v2
 * FOR MORE DETAILS.
 */

/*
 * @Author: qiulin 1746365080@qq.com
 * @Date: 2024-10-23 16:11:24
 * @LastEditors: qiulin 1746365080@qq.com
 * @LastEditTime: 2024-10-24 10:56:22
 * @FilePath: /SGSim/Import/ImportAPI/ImportAPI.h
 */

#pragma once

#include <memory>
#include <string>

#include "Common/ImportExport.h"
#include "Common/ImportNamespace.h"

DBSERVICEFACTORY_DEC

SG_IMPORT_NAMESPACE_OPEN

/**
 * 导入器，用于将数据模型导入数据库
 * 先创建该对象，然后调用对应文件类型的Import方法
 */
class Import_DECLSPEC SGImporter
{
  public:
    /// @brief 构建SGImport
    /// @param  DBServiceFactory指针
    SGImporter (std::shared_ptr<SG::DBManager::DBServiceFactory>);

    /// @brief 导入BDF模型文件
    /// @param filepath 文件路径
    /// @return 导入状态
    SG::DataStructure::Common::Status Import (const std::string& filepath);

  private:
    std::shared_ptr<SG::DBManager::DBServiceFactory> m_dbServiceFactory;  ///<  DBServiceFactory指针,调用该工厂创建的Service存储数据
};

SG_IMPORT_NAMESPACE_CLOSE
